<template>
    <div class="chatBtn">
        <button open-type="getUserInfo" @getuserinfo="bindGetUserInfo">私信</button>
    </div>
</template>

<script>
import { xdLogin } from "@/utils/login"
export default {
    props: ['userInfo'],
    methods:{
       bindGetUserInfo(e){
          var that=this;
           wx.getStorage({
              key: 'token',
              success: (result) => {
                 wx.navigateTo({
                    url: '/pages/chatOnLine/main?info=' + JSON.stringify(this.userInfo)
                })
                    
              },
              fail: () => {
                  xdLogin(e).then((res)=>{

                  })
              },
              complete: () => {}
           });
             
       }
    }
}
</script>

<style lang="scss" >

    .chatBtn{
        button{
            width:71px;
            border:1px solid rgba(102,102,102,1);
            border-radius:5px;
            text-align:center;
            font-size:14px;
            font-weight:500;
            color:rgba(51,51,51,1);
            line-height: 27px;
            margin-right: 10px;
            background: #fff;
        }
    }
</style>
